package com.atguigu.gmall.product.service.impl;

import com.atguigu.gmall.model.product.BaseTrademark;
import com.atguigu.gmall.product.mapper.BaseTradeMarkMapper;
import com.atguigu.gmall.product.service.BaseTradeMarkService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class BaseTradeMarkServiceImpl extends ServiceImpl<BaseTradeMarkMapper,BaseTrademark> implements BaseTradeMarkService {

    @Autowired
    private BaseTradeMarkMapper baseTradeMarkMapper;
    /**
     * 查询数据
     * @param baseTrademarkPage
     * @return
     */
    @Override
    public IPage getTradeMarkPage(Page<BaseTrademark> baseTrademarkPage) {
        QueryWrapper<BaseTrademark> baseTrademarkQueryWrapper = new QueryWrapper<>();
        baseTrademarkQueryWrapper.orderByDesc("id");
        return baseTradeMarkMapper.selectPage(baseTrademarkPage, baseTrademarkQueryWrapper);
    }
}
